import Sprite from '../base/sprite'
import DataBus from '../databus'
let databus = new DataBus()

const screenWidth  = window.innerWidth
const screenHeight = window.innerHeight

const BG_IMG_SRC   = 'images/rail.png'
const BG_WIDTH     = 600
const BG_HEIGHT    = 630

export default class BackGround extends Sprite {
    constructor(ctx) {
        super({
            imgSrc: BG_IMG_SRC,
            imgW: BG_WIDTH,
            imgH: BG_HEIGHT,
            canvasY: databus.gridConfig.top,
            canvasH: databus.gridConfig.height

        })
        this.render(ctx)
    }

    render(ctx) {
        this.drawToCanvas(ctx)
    }
}